package com.theexceptions.todo.model;

/**
 * A filter that sorts tasks by finding those that come after a provided date.
 * Note: Date is inclusive. If you're filtering for after 06/12/1993, then
 * 06/12/1993 will be included in the search.
 * 
 * @author Justian Meyer
 */
public class DateFilter implements TaskFilter {

	private long time;

	/**
	 * Constructs a filter with a time to filter by.
	 * 
	 * @param time Time in Milliseconds
	 */
	public DateFilter(long time) {
		this.time = time;
	}

	@Override
	public String getQuery() {
		String column = DatabaseHelper.TASKS_DATE;
		return String.format("%s >= '%d'", column, time);
	}

}